def InsertSort(a):
    for i in range(1,len(a)):
        if a[i]<a[i-1]:
            temp=a[i]
            j=i-1
            while j>=0 and temp<a[j]:
                a[j+1]=a[j]
                j-=1
            a[j+1]=temp
    print(a)

a = [4, 3, 99, 7, 9]
print(a)
InsertSort(a)